package lanqiao;

import java.util.Scanner;

/**
 * @Project : ProgrammingExercises
 * @Package : LanQiao.PrepareForCompetition
 * @File : Q2080.java
 * @Author : WangRuoyu
 * @Date 2023/3/10 17:44
 */
public class Q2080 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int a = 0;
        long sum = 0;
        long tmp = 0;

        for (int i = 0; i < n; ++i) {
            a = input.nextInt();
            sum += a;
            tmp += (a * a);
        }

        System.out.println((sum * sum - tmp)/2);
    }
}


